package com.migo.api;

import com.migo.annotation.IgnoreAuth;
import com.migo.service.TechnicalSupportService;
import com.migo.service.TechnicalSupportTypeService;
import com.migo.utils.R;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by Wes on 2019/1/15.
 */
@RestController
@RequestMapping("/api")
public class ApiTechnicalSupportController  extends ApiBaseController{

    @Autowired
    private TechnicalSupportTypeService technicalSupportTypeService;

    @Autowired
    private TechnicalSupportService technicalSupportService;


    /**
     * 查询技术支持类型表
     */
    @IgnoreAuth
    @RequestMapping("/queryTechnicalSupportTypeList")
    public R queryTechnicalSupportTypeList(String proId,String language) throws Exception {
        Map<String,Object> paramMap = new HashedMap();
        paramMap.put("proId",proId);
        paramMap.put("language",language);
        return R.ok().put("data",technicalSupportTypeService.queryList(paramMap));
    }

    /**
     * 查询技术支持列表
     */
    @IgnoreAuth
    @RequestMapping("/queryTechnicalSupportList")
    public R queryTechnicalSupportList(String typeId,String language) throws Exception {
        Map<String,Object> paramMap = new HashedMap();
        paramMap.put("typeId",typeId);
        return R.ok().put("data",technicalSupportService.queryList(paramMap));
    }



}
